# -*- coding: utf-8 -*-

import tornado.web
import tornado.httpserver
import tornado.ioloop

from handlers import TestHandler



# overwrite
routes = [
    (r'/test', TestHandler),
]


def mainloop(port):
    app = tornado.web.Application(routes)
    svr = tornado.httpserver.HTTPServer(app)
    svr.listen(port)
    loop = tornado.ioloop.IOLoop.instance()
    try:
        loop.start()
    except KeyboardInterrupt:
        loop.stop()
